/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * JpnlFinalSummary.java
 *
 * Created on 08/06/2010, 16:58:20
 */
package systole.view.tabs.finalsegment;

import java.awt.GridLayout;
import org.jfree.chart.ChartPanel;
import org.jfree.chart.renderer.xy.XYItemRenderer;
import systole.view.charts.XYChart;

/**
 *
 * @author user
 */
public class JpnlFinalSummary extends javax.swing.JPanel {

    private JPnlResults results;

    /**
     *
     */
    private static final long serialVersionUID = -3209645125457297292L;

    /** Creates new form JpnlFinalSummary */
    public JpnlFinalSummary(JPnlResults results) {
        initComponents();
        this.results = results;
    }

    /**
     *
     * @param overlayedSegments
     * @param finalSegment
     * @param derivatives
     */
    public void loadSummary(XYChart overlayedSegments, XYChart finalSegment, XYChart derivatives) {

        this.removeAll();
        this.setLayout(new GridLayout(2, 2));

        overlayedSegments.setShowLegend(false);
        ChartPanel cp = overlayedSegments.plot();
        cp.setMouseZoomable(false);
        cp.setPopupMenu(null);
        this.add(cp);

        finalSegment.setShowLegend(false);
        cp = finalSegment.plot();
        cp.setMouseZoomable(false);
        cp.setPopupMenu(null);
        this.add(cp);

        derivatives.setShowLegend(false);
        ChartPanel derivativesChart = derivatives.plot();
        derivativesChart.setMouseZoomable(false);
        derivativesChart.setPopupMenu(null);
        XYItemRenderer rend = derivativesChart.getChart().getXYPlot().getRenderer();
        rend.setSeriesVisible(3, false, true);
        rend.setSeriesVisible(4, false, true);

        this.add(derivativesChart);
        this.add(results);
        this.revalidate();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        setName("Form"); // NOI18N
        setLayout(new java.awt.GridLayout(2, 2));
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables
}
